package com.ys.erp.gateway.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.reactive.config.WebFluxConfigurer;

/**
 * @author minamiyama
 * @date 2024/12/10 15:23
 */
@Configuration
public class GlobalCorsConfig implements WebFluxConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                // 支持通配符
                .allowedOriginPatterns("*")
                // 允许所有方法
                .allowedMethods("*")
                // 允许所有头
                .allowedHeaders("*")
                // 允许携带凭据
                .allowCredentials(true);
    }
}
